<%@page import="org.apache.commons.lang3.StringUtils"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@include file="user-index-head.jsp"%> 
<%
	String str = (String)request.getAttribute("ret");
	if(!StringUtils.isEmpty(str)){
		out.print("<script>alert('"+str+"');window.location='vote!index.do';</script>");
	}
%>
<div class="content">
         
          <div class="cLineB">
              <h4 class="left">发起投票</h4>
              <div class="clr"></div>
          </div>
          <div class="cLine">
            <div class="pageNavigator left">
  			<a href="<%=path %>/user/vote!add.do?type=text" title="发起文字投票" class="btnGrayS vm bigbtn"><img src="/themes/User/default/common/images/text.png" class="vm">发起文字投票</a>
  　		<a href="<%=path %>/user/vote!add.do?type=image" title="发起图片投票" class="btnGrayS vm bigbtn"><img src="themes/User/default/common/images/pic.png" class="vm">发起图片投票</a>　　
            </div>
          
            <div class="clr"></div>
          </div>
          <div class="msgWrap">
          <form method="post" action="vote!delete.do" id="info">
          <input name="delall" type="hidden" value="del">
           <input name="wxid" type="hidden" value="gh_423dwjkewad">
            <table class="ListProduct" border="0" cellspacing="0" cellpadding="0" width="100%">
              <thead>
                <tr>
					<th class="select">选择</th>
					<th>关键词</th>
					<th>标题</th>
					<th>类型</th>
					<th class="time">开始时间</th>
					<th class="time">结束时间</th>
					<th>外链代码</th>
					<th class="norightborder">操作</th>
                </tr>
              </thead>
              <tbody>
                  
                <s:iterator id="key" value="#request.page.content" status="i">
                <s:if test="#key.vote.status !='D' " >
				 <tr>
                  <td>
                  	<input type="checkbox" name="del_id[]" class="checkitem">
                  	<input type="hidden" name="voteId" value="<s:property value="#key.vote.id" />" >
                  </td>
                  <td><s:property value="#key.vote.keyword.keyword" /> </td>
                  <td><s:property value="#key.vote.title" /></td>
                  <td>
                  	<s:if test="#key.vote.type =='text'" >文字投票<input type="hidden" name="keyword.vote.type" value="text"></s:if>
                  	<s:else>图片投票<input type="hidden" name="keyword.vote.type" value="image"></s:else>
                  </td>
                  <td><s:property value="#key.vote.startTime" /></td>
                  <td><s:property value="#key.vote.endTime" /></td>
                  <td>文字投票674</td>
                  <td class="norightborder">
					<!-- 已经结束的投票才可以查看结果 -->
					<s:if test="#key.vote.status =='E' " >
						<a href="javascript:void(0)" name="show_result">投票结果</a>
					</s:if>
					
					<!-- 只有初始状态的投票才可以编辑 -->
					<s:if test="#key.vote.status =='I' " >
						<a href="javascript:void(0)" name="edit">编辑</a>
					</s:if>
					
					<!-- 初始状态 或者 已经结束 的投票才可以删除 -->
					<s:if test="#key.vote.status =='I' || #key.vote.status =='E' " >
						<a href="javascript:void(0)" name="delete">删除</a>
					</s:if>
					<s:if test="#key.vote.status =='I' " >
						<a href="javascript:void(0)" name="start">开始</a>
					</s:if>
					<s:elseif test="#key.vote.status =='S'" >
						<a href="javascript:void(0)" name="end">结束</a>
					</s:elseif>
					<!-- <a href="javascript:drop_confirm2('开始投票活动将预先扣除1000金币，折合RMB 1元 ', '<%=path %>/user/vote!start.do', this);">开始</a> -->
				  </td>
                </tr>
                </s:if>
				</s:iterator>
				
      			<tr>
                <td colspan="8">
                	<input type="checkbox" id="chkall" name="chkall" onclick="checkall(this.form, 'del_id')"><label for="checkallBottom">全选</label>
					<input type="radio" checked="checked" name="optype" value="1">删除
					<a href="JavaScript:void(0);" id="del_sel" class="btnGreens"><span>确定</span></a>
				</td>
                </tr>
              </tbody>
            </table>
           </form> 
           <script src="<%=path %>/js/module/vote.js"></script>
          </div>
            
          <div class="cLine">
            <div class="pageNavigator right">
                 <div class="pages"></div>
              </div>
            <div class="clr"></div>
          </div>
        </div>
<include file="Public:footer"/>